using System;
using System.Collections.Generic;
using System.Text;

namespace Krile.Kernel
{
    //Inherited By Krile.Krile.Kernel

    /// <summary>
    /// Operation Result Data
    /// </summary>
    /// <typeparam name="Type">Received Data Type</typeparam>
    public class OperationResult<Type>
    {
        /// <summary>
        /// Operated URI
        /// </summary>
        public Uri OperationUri;

        /// <summary>
        /// Operation result
        /// </summary>
        public bool Succeeded;

        /// <summary>
        /// Returning message
        /// </summary>
        public string Message;

        /// <summary>
        /// Thrown exception
        /// </summary>
        public Exception Exception;

        /// <summary>
        /// Error operation enumerator
        /// </summary>
        public enum ErrorOperations
        {
            /// <summary>
            /// Ignorable
            /// </summary>
            Ignore,
            /// <summary>
            /// Inform this result
            /// </summary>
            Inform,
            /// <summary>
            /// Worn this error
            /// </summary>
            Worn,
            /// <summary>
            /// Treat as fatal error
            /// </summary>
            Fatal
        } ;

        /// <summary>
        /// Error operation
        /// </summary>
        public ErrorOperations ErrorOperation;

        /// <summary>
        /// Returning data
        /// </summary>
        public Type Data;

        public OperationResult() { }

        public OperationResult(Uri uri)
        {
            this.OperationUri = uri;
        }

        public OperationResult(Uri uri, System.Exception e)
        {
            this.OperationUri = uri;
            this.Exception = e;
        }

    }
}
